local jumpspeed = 0

mini_jump_speedo = 
{
    userData = {}
}
registerWidget("mini_jump_speedo");


function mini_jump_speedo:draw()

    ------ Early out if HUD shouldn't be shown. ------
    if not shouldShowHUD() then return end

    ------ GET PLAYER ------
    local player = getPlayer();

    ------ TEXT FORMATTING OPTIONS -------
    nvgFontSize(72);
    nvgTextAlign(NVG_ALIGN_CENTER, NVG_ALIGN_TOP);

    ------ DRAW TEXT ------
    local white = Color(255,255,255)
    local black = Color(0,0,0)

    if player.jumpTimer <= deltaTime * 1200 then
        jumpspeed = player.speed
    end

    nvgFillColor(black)
    nvgText(3, 3, math.ceil(jumpspeed))
    nvgFillColor(white)
    nvgText(0, 0, math.ceil(jumpspeed))

end
